home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15413 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Date
  5. Date: Thu, 18 Apr 96 20:50:01 GMT
  6. Organization: none
  7. Message-ID: <829860601snz@genesis.demon.co.uk>
  8. References: <317322F1.1350@is.nyu.edu>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <317322F1.1350@is.nyu.edu>
  15.            cqr2051@is.nyu.edu "Collin Rodolitz" writes:
  16.  
  17. >How do you get the date in C on a UNIX machine?
  18.  
  19. See the standard C functions in time.h. You can get a value that represents
  20. the current date and time using the time() function. You can break it
  21. out into a structure of component values (seconds, hour of day, day of month
  22. etc.) using localtime() or gmtime(). You can generate or print out formatted
  23. time string using asctime(), ctime() and strftime(). You can calculate the
  24. difference between two time values in seconds using difftime().
  25.  
  26. -- 
  27. -----------------------------------------
  28. Lawrence Kirby | fred@genesis.demon.co.uk
  29. Wilts, England | 70734.126@compuserve.com
  30. -----------------------------------------
  31.